<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>多分支if else语句</title>
</head>
<body>
    <script>
        //根据今天星期几，输出今天的菜单
        /*var week=parseInt(prompt('请输入今天是星期几'));
        switch(week){
            case 1:alert('烤鸡腿');break;
            case 2:alert('水煮派蒙');break;
            case 3:alert('牛肉面');break;
            case 4:alert('冰淇凌');break;
            case 5:alert('烧烤派蒙');break;
            case 6:alert('辣椒炒派蒙');break;
            case 7:alert('烤矮堇瓜');break;
            default:alert('输入错误');break;
        }*/

        var city=prompt('');
        switch(city){
            case 'beijing':alert('1');break;
            case 'shanghai':alert('2');break;
            case 'shenzhen':alert('3');break;
        }
        // var num=100;
        // if(num=0){
        //     num+=10;
        // }else{
        //     num++;
        // }
        // console.log(num);
    </script>
</body>
</html>